<? ini_set('memory_limit','1000M');?>
<style>
body { margin-top:25; font-size:12px;}
		.b_line { border-bottom:1px #AAAAAA solid; height:25px; font-size:14px}
		.border_t{border-top:1px inset #EEE;}
		.border_b{border-bottom:1px inset #EEE;}
		.border_l{border-left:1px inset #EEE;}
		.border_r{border-right:1px inset #EEE;}
		.xx:hover {cursor:pointer; background:#99FF99;}
		.xy:hover {cursor:pointer; background:#F30;}
		.box{border:1px solid #003}
		.box_lbr{border:1px solid #003; border-top:none}
		.box_ltr{border:1px solid #003; border-bottom:none}
		.box_l{border-left:1px solid #003;}
		.box_r{border-right:1px solid #003;}
		.box_tb{border-top:1px solid #003; border-bottom:1px solid #003;}
		.box_lb{border-left:1px solid #003;border-bottom:1px solid #003;}
		.box_rb{border-right:1px solid #003;border-bottom:1px solid #003;}
		.list_genap{cursor:pointer; background-color:#6699FF;}
		.list_ganjil{cursor:pointer; background-color:#9966FF;}
		.list_closed{cursor:pointer; background-color:#FF99FF;}
</style>
<table style='border-collapse:collapse' width='99%'>
	<tr align='center'><td colspan='11'><h2><?=$coy;?></h2><?=$add;?></td></tr>
	<tr align='center'><td colspan='11'><h1>NERACA PERCOBAAN</h1></td></tr>
	<thead>
	<tr><td>Periode :<?=$from_tgl;?> s/d <?=$up_tgl;?></td><td colspan='10'>&nbsp;</td></tr>
	<tr class='box list_genap' align='center'>
		<th rowspan='2' class='box' width='25%'>No. Perkiraan</th>
		<th colspan='2' class='box' width='15%'>Saldo Awal</th>
		<th colspan='2' class='box' width='15%'>Mutasi</th>
		<th colspan='2' class='box' width='15%'>Neraca Percobaan</th>
		<th colspan='2' class='box' width='15%'>Rugi/Laba</th>
		<th colspan='2' class='box' width='15%'>Neraca</th>
	</tr>
	<tr class='box list_genap' align='center'>
		<th class='box' width='7%'>Debet</th>
		<th class='box' width='7%'>Kredit</th>
		<th class='box' width='7%'>Debet</th>
		<th class='box' width='7%'>Kredit</th>
		<th class='box' width='7%'>Debet</th>
		<th class='box' width='7%'>Kredit</th>
		<th class='box' width='7%'>Debet</th>
		<th class='box' width='7%'>Kredit</th>
		<th class='box' width='7%'>Debet</th>
		<th class='box' width='7%'>Kredit</th>
	</tr>
	</thead>
 <? $n=0; $data=array();
 		$t_sa_awal_d =0;$t_sa_awal_k =0;$t_neraca_pk =0;$t_neraca_pd =0;$t_mutasi_k  =0;
		$t_mutasi_d  =0;$t_neraca_k  =0;$t_neraca_d  =0;$t_lbr_k 	 =0;$t_lbr_d 	 =0;
	$jml=0;$jml2=0;
 	foreach($lst as $r)
	{
		 $n++;
		 $jml=$this->main_model->rdb('v_akun_neraca','count(kd_akun) as kd_akun',"where kd_akun < 200");
		 $jml2=$this->main_model->rdb('v_akun_neraca','count(kd_akun) as kd_akun',"where kd_akun >= 200 and kd_akun < 400");
	 ?>
		<tr class=''>
			<td class=''><font color="#FFFFFF"><?=str_repeat("x",(strlen($r->kd_akun)-1));?></font><?=$r->kd_neraca.". ".$r->cnama;?></td>
			<td class=''><?=$jml.":".$jml2.":".$n ;?></td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
		</tr>
	<?
	if($n==$jml || $n==($jml+$jml2)){
	?>
		<tr class='list_closed'>
			<td class='box_tb'><font color="#FF99FF"><?=str_repeat("x",(strlen($r->kd_akun)-1));?></font><b>Total</b></td>
			<td class='box_tb'><? ;?></td>
			<td class='box_tb'>&nbsp;</td>
			<td class='box_tb'>&nbsp;</td>
			<td class='box_tb'>&nbsp;</td>
			<td class='box_tb'>&nbsp;</td>
			<td class='box_tb'>&nbsp;</td>
			<td class='box_tb'>&nbsp;</td>
			<td class='box_tb'>&nbsp;</td>
			<td class='box_tb'>&nbsp;</td>
			<td class='box_tb'>&nbsp;</td>
		</tr>
		
	 <? 
		}
	}
?>
		<tr class='' align='right' >
			<td class=''><?=$this->main_model->rdb('v_akun_neraca','cnama',"where kd_neraca='307' and kd_akun='307'") ;?></td>
			<td class=''><? ;?></td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
		</tr>
		<tr class='' align='right'>
			<td class=''  colspan='6'>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
			<td class=''>&nbsp;</td>
		</tr>
		<!-----Footer tanda tangan ---->
			<? $kt=explode("-",$kota);?>
			<tr>
				<td colspan='5'></td>
				<td colspan='3' align='center' class='box'><?='Yang memeriksa';?></td><td colspan='3' class='box' align='center'><?='Yang membuat';?></td>
				</tr>
			<tr height="65px">
			<td colspan='5'>&nbsp;</td>
			<td colspan='3' class='box' align='center' valign='top'>&nbsp;</td>
			<td colspan='3' class='box' align='center' valign='top'>&nbsp;</td></tr>
	
</table>